<script setup>
import { ref} from "vue";
import request8090 from "../../utils/request8090.js";

const data = ref([])
const config = ref({
  data: data,
  unit: '人数',
  showValue: true,
})
const getData = () => {
  request8090({
    url: '/getacademystudents',
    method: 'get',
  }).then((res) => {
    if (res && res.data && Array.isArray(res.data.data)) {
      // 映射数据
      data.value = res.data.data.map(item => ({
        name: item.academy,
        value: item.studentCount
      }));
    }
  })
}
getData()
</script>

<template>
  <dv-capsule-chart :config="config" style="width:300px;height:200px;margin-left: 20px;"/>

</template>

<style scoped>

</style>
